package org.heima.core;

import lombok.*;
import org.heima.core.transaction.Transaction;

import java.util.Map;

@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
@ToString
public class SqlSessionFactory {

    //事务管理器属性(面向接口编程，一个接口多个实现类)
    //ex:JDBC  MANAGE
    Transaction transaction;
    //数据源属性

    //存放sql语句的map集合
    //key是sql id
    //value为对应的sql标签信息对象
    Map<String,MapperStatement> mapperStatementMap;

    public SqlSession openSession(){
        transaction.openConnection();
        SqlSession sqlSession = new SqlSession(this);
        return sqlSession;
    }

}
